

%% \: Running NORDIC
%% For more information on the arguments used here see: https://layerfmri.com/nordic/
%% Knudsen, L., Vizioli, L., De Martino, F., Faes, L.K., Handwerker, D.A., Moeller, S., Bandettini, P.A., Huber, L., 2025. 
%% NORDIC denoising on VASO data. Front. Neurosci. 18, 1499762. https://doi.org/10.3389/fnins.2024.1499762


function NORDIC_executing (pathtofile)
display(pathtofile);


                ARG.NORDIC=1;
                ARG.noise_volume_last = 1;
                ARG.save_add_info =1;
                ARG.magnitude_only=1;
                ARG.factor_error=1.2
                %ARG.MP = 2; 
                ARG.kernel_size_PCA = [10, 10, 10]; 
                ARG.write_gzipped_niftis=1;

                fn_magn_in=pathtofile;
                fn_phase_in=fn_magn_in;
                fn_out=['NORDIC_' fn_magn_in];
                NIFTI_NORDIC(fn_magn_in,fn_phase_in,fn_out,ARG)  

exit
